package com.hlyj.http.base.tool.lib_hlyj_base.qrcode

import android.util.Log
import okhttp3.Interceptor
import okhttp3.Response

class MyLoggingInterceptor : Interceptor {
    override fun intercept(chain: Interceptor.Chain): Response {
        val originalRequest = chain.request()

        // 1. 打印完整 URL（包含 Query 参数）
        Log.d("API", "Request URL: ${originalRequest.url}")
         var appCode="8c8a63d0e151465a8dcce3a7a9be0a43"
        // 2. 添加 Header
        val newRequest = originalRequest.newBuilder()
            .header("Authorization", "APPCODE $appCode") // 保留 Header 方式（可选）
            .header("Content-Type", "application/json; charset=UTF-8")
            .build()
        return chain.proceed(newRequest)
    }
}